<% #endcoding:utf-8%>
<div class="panel">
  <div class="panel-heading">
    <h3 class="demand-top">用户信息</h3>
    </div>
  <div class="panel-body">
    <div>
      <%=render partial: @user.user_type? ? 'factory_name_card':'counselor_name_card'%>
<%if @user.id==session[:user_id]%>
          <p></p>
      <p class="text-center">
        <%=link_to '编辑','/editprofile',class:'btn btn-block btn-warning'%>
      </p>
<%else%>
    <%if @user.user_type%>
      <p class="text-center"><%=image_tag 'follow.png'%>(<span class="followercount"><%=@user.followers.count%></span>)</p>
      <p class="text-center">
        <%if session[:user_id].nil?%>
            <%=link_to "加关注",session[:user_id].nil? ? login_path : "javascript:void(0)",:onclick=>"follow("+@user.id.to_s+",this)",:class=>'btn btn-default'%>
        <%else%>
            <%if userinfo.following?(@user)%>
                <%=link_to "取消关注","javascript:void(0)",:onclick=>"unfollow("+@user.id.to_s+",this)",:class=>'btn btn-default'%>
            <%else%>
                <%=link_to "加关注","javascript:void(0)",:onclick=>"follow("+@user.id.to_s+",this)",:class=>'btn btn-default'%>
            <%end%>
        <%end%>
      </p>
      <p class="overday text-center">关注厂家的验厂动态</p>
      <%end%>
<%end%>
    </div>
</div>
  </div>
  <div class="panel">
    <%if !@user.user_type?%>
        <div class="panel-heading"><h3 class="demand-top">评价</h3></div>
          <div class="panel-body">
            <%if @evaluates.any?%>
                <ul class="list-group">
                  <%=render @evaluates%>
                </ul>
                <%=will_paginate @evaluates%>
            <%else%>
            <%=render partial: "shared/no_content"%>
            <%end%>
          </div>
  <%end%>
</div>